import request from '@/utils/request'

/** 关闭工单任务 */ 
export function protaskClose(data) {
  return request({
    url: '/mes/pro/protask/close',
    method: 'post',
    data
  })
}

/** 派工工单任务*/ 
export function protaskTaskDispatch(data) {
  return request({
    url: '/mes/pro/protask/taskDispatch',
    method: 'post',
    data
  })
}

/** 质检派工工单任务*/ 
export function protaskCheckDispatch(data) {
  return request({
    url: '/mes/pro/protask/checkDispatch',
    method: 'post',
    data
  })
}

/** 完成工单任务*/ 
export function protaskFinish(taskId) {
  return request({
    url: '/mes/pro/protask/finish/' + taskId,
    method: 'post'
  })
}

/**重启工单任务 */ 
export function protaskReopen(data) {
  return request({
    url: '/mes/pro/protask/reopen',
    method: 'post',
    data
  })
}

/**工单任务物料清单 */ 
export function protaskTaskBom(taskId) {
  return request({
    url: '/mes/pro/protask/taskBom/' + taskId,
    method: 'post'
  })
}

/**工单任务退料记录 */ 
export function protaskRtIssue(taskId) {
  return request({
    url: '/mes/pro/protask/rtIssue/' + taskId,
    method: 'get'
  })
}

/** 工单任务执行进度*/ 
export function protaskProgress(taskId) {
  return request({
    url: '/mes/pro/protask/progress/' + taskId,
    method: 'get'
  })
}

/** 工单任务领料记录*/ 
export function protaskIssue(taskId) {
  return request({
    url: '/mes/pro/protask/issue/' + taskId,
    method: 'get'
  })
}

/** 工单任务报工记录*/ 
export function protaskFeedback(taskId) {
  return request({
    url: '/mes/pro/protask/feedback/' + taskId,
    method: 'get'
  })
}

/** 工单任务作业指导*/ 
export function protaskGuidance(taskId) {
  return request({
    url: '/mes/pro/protask/guidance/' + taskId,
    method: 'get'
  })
}

/** 工单任务作业指导*/ 
export function getDispatchInfo(taskId) {
  return request({
    url: '/mes/pro/protask/getDispatchInfo/' + taskId,
    method: 'post'
  })
}

/** 工单任务开工*/
export function protaskTaskStart(taskId) {
  return request({
    url: '/mobile/pro/protask/punchCardIn/'+ taskId,
    method: 'post',
  })
}

/** 工单任务详情*/ 
export function protaskInfo(taskId) {
  return request({
    url: '/mes/pro/protask/' + taskId,
    method: 'get'
  })
}

// 工序流转信息
export function processFlowInfo(taskId) {
  return request({
    url: '/mes/pro/protask/processFlow/' + taskId,
    method: 'get'
  })
}